package ArrayListTest.homework;

import java.io.File;
import java.sql.SQLOutput;

public class FileDemo {
    public static void main(String[] args) {
        File file = new File("demo.text");
        //File file = new File("C:\\Users\\TEDU\\IdeaProjects\\jsd2410\\demo.txt");
        System.out.println("文件名："+file.getName());
        System.out.println("文件大小："+file.length()+"个字节");
        System.out.println("是否可读："+file.canRead());
        System.out.println("是否可写："+file.canWrite());
        System.out.println("是否是文件："+file.isFile());
        System.out.println("是否是目录："+file.isDirectory());
        System.out.println("是否存在："+file.exists());

    }
}
